using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TouchTriggerObject : MonoBehaviour
{
    public PlayerElement element;
    public Player_FSM PlayerFsm;
    public bool HasTriggered = false;
    protected Animator animator;
    protected float stateStartTime;
    protected bool IsStateFinished => StateDuration >= animator.GetCurrentAnimatorStateInfo(0).length;
    protected float StateDuration => Time.time - stateStartTime;
    virtual public void TriggerEvent()
    {
        
    }
    private void OnTriggerStay2D(Collider2D collider)
    {
        if (HasTriggered)
        {
            return;
        }
        else if ((collider.tag == "Player")&&(PlayerFsm.currentEle == element))
        {
            TriggerEvent();
            HasTriggered = true;
        }
    }
}
